﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Smartee.Modelling
{
    public partial class ModelControl : UserControl
    {
        public ModelControl()
        {
            InitializeComponent();
        }

        private Drawing _drawing = null;
        public Drawing Drawing { get { return _drawing; } set { _drawing = value; Refresh(); } }

        private void ModelControl_Paint(object sender, PaintEventArgs e)
        {
            if (_drawing != null)
            {
                IVisitor drawer = new SystemGraphicsDrawer(e.Graphics);
                _drawing.Accept(drawer);
            }
        }
    }
}
